/**
 * Generali Solutions d'assurances - Tous droits réservés &copy; 2007 - 2010
 */

package fr.generali.accueilclient.client.preferences.builder;

import fr.generali.accueilclient.client.preferences.om.IOMBcPreferences;
import fr.generali.accueilclient.client.preferences.om.impl.OMBcPreferences;

/**
 * @author Holmes Kelly
 */
public class OMBcPreferencesBuilder extends OMBcPreferencesBuilderBase<OMBcPreferencesBuilder> {

    /**
     * constructeur
     */
    public OMBcPreferencesBuilder() {
        super(new OMBcPreferences());
    }

    /**
     * @return OMBcPreferencesBuilder
     */
    public static OMBcPreferencesBuilder oMBcPreferences() {
        return new OMBcPreferencesBuilder();
    }

    /**
     * @return OMBcPreferences
     */
    public IOMBcPreferences build() {
        return getInstance();
    }
}

/**
 * @author Holmes Kelly
 * @param <GeneratorT>
 */
class OMBcPreferencesBuilderBase<GeneratorT extends OMBcPreferencesBuilderBase<GeneratorT>> {

    /**
     * instance
     */
    private IOMBcPreferences instance;

    /**
     * @param aInstance instance
     */
    protected OMBcPreferencesBuilderBase(IOMBcPreferences aInstance) {
        instance = aInstance;
    }

    /**
     * @return instance
     */
    protected IOMBcPreferences getInstance() {
        return instance;
    }

    /**
     * @param aValue id utilisateur
     * @return GeneratorT
     */
    @SuppressWarnings("unchecked")
    public GeneratorT buildIdUtilisateur(String aValue) {
        instance.setIdUtilisateur(aValue);

        return (GeneratorT ) this;
    }

    /**
     * @param aValue type recherche
     * @return GeneratorT
     */
    @SuppressWarnings("unchecked")
    public GeneratorT buildTypeRecherche(String aValue) {
        instance.setTypeRecherche(aValue);

        return (GeneratorT ) this;
    }

    /**
     * @param aValue numero colonne
     * @return GeneratorT
     */
    @SuppressWarnings("unchecked")
    public GeneratorT buildNumColonne(Integer aValue) {
        instance.setNumColonne(aValue);

        return (GeneratorT ) this;
    }

    /**
     * @param aValue libelle court
     * @return GeneratorT
     */
    @SuppressWarnings("unchecked")
    public GeneratorT buildLibelleCourt(String aValue) {
        instance.setLibelleCourt(aValue);

        return (GeneratorT ) this;
    }

    /**
     * @param aValue visible
     * @return GeneratorT
     */
    @SuppressWarnings("unchecked")
    public GeneratorT buildVisible(String aValue) {
        instance.setVisible(aValue);

        return (GeneratorT ) this;
    }
}
